package algorithmTopics.array;


import java.util.ArrayList;
import java.util.List;

/**
 * 测试一下 数组
 * test4:表示 力扣的第四题,数字就表示第几题
 *
 * @author 86155
 * @date 2025/05/15
 */
public class test {

    public static void main(String[] args) {
        Solution solution = new Solution();
        //solution.maximumValueOfDpIndex(new int[]{1,2,2}).forEach(System.out::println);
        test673(solution);
    }

    private static void test673(Solution solution) {
        //solution.findNumberOfLIS(new int[] {1,3,5,4,7});
        //solution.findNumberOfLIS(new int[] {1,2,4,3,5,4,7,2});
        solution.findNumberOfLIS(new int[] {2,2,2,2,2});
    }

    private static void test931(Solution solution) {
        solution.minFallingPathSum(new int[][]{{-80, -13, 22}, {83, 94, -5}, {73, -48, 61}});
    }

    private static void test120(Solution solution) {

        solution.minimumTotal(List.of(
                List.of(2),
                List.of(3, 4),
                List.of(6, 5, 7),
                List.of(4, 1, 8, 3)));
    }

    private static void test63(Solution solution) {
        solution.uniquePathsWithObstacles(new int[][]{{0, 0, 0}, {0, 1, 0}, {0, 0, 0}});
    }

    private static void test1232(Solution solution) {
        solution.checkStraightLine(new int[][]{{1, -3}, {2, -3}, {1, -3}});
    }

    private static void test73(Solution solution) {
        solution.setZeroes(new int[][]{{1, 2, 3}, {0, 5, 6}, {7, 8, 9}});
    }

    private static void test54(Solution solution) {
        solution.spiralOrder(new int[][]{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
    }

    private static void test287(Solution solution) {
        solution.findDuplicate(new int[]{1, 3, 4, 2, 2});
    }

    private static void test31(Solution solution) {
        solution.nextPermutation(new int[]{3, 2, 1});
    }

    private static void test1143(Solution solution) {
        solution.longestCommonSubsequence("abcde", "ace");
    }

    private static void test64(Solution solution) {
        solution.minPathSum(new int[][]{{1, 2, 3}, {4, 5, 6}});
    }

    private static void test62(Solution solution) {
        solution.uniquePaths(3, 3);
    }

    private static void test32(Solution solution) {
        solution.longestValidParentheses("(()");
    }

    private static void test416(Solution solution) {
        solution.canPartition(new int[]{1, 5, 5, 11});
    }

    private static void test152(Solution solution) {
        solution.maxProduct(new int[]{-2, -3, 7});
    }

    private static void test300(Solution solution) {
        solution.lengthOfLIS(new int[]{0, 1, 0, 3, 2, 3});
    }

    private static void test322(Solution solution) {
        System.out.println(solution.coinChange(new int[]{1, 2, 5}, 11));
    }

    private static void test279(Solution solution) {
        System.out.println(solution.numSquares(12));

    }

    private static void test51(Solution solution) {
        solution.solveNQueens(4);
    }

    private static void test131(Solution solution) {
        solution.partition("aab");
    }

    private static void test79(Solution solution) {
        //solution.exist(new char[][]{{'A','B','C','E'},{'S','F','C','S'},{'A','D','E','E'}},"ABCB");
        solution.exist(new char[][]{{'A', 'B'}, {'S', 'F'}}, "ASFB");
    }

    private static void test39(Solution solution) {
        solution.combinationSum(new int[]{2, 3, 6, 7}, 7);
    }

    private static void test17(Solution solution) {
        solution.letterCombinations("23");
    }

    private static void test78(Solution solution) {
        solution.subsets(new int[]{1, 2, 3});
    }

    private static void test46(Solution solution) {
        solution.permute(new int[]{1, 2, 3});
    }

    private static void test56(Solution solution) {
        solution.merge(new int[][]{{1, 4}, {2, 5}});
    }

    private static void test239(Solution solution) {
        solution.maxSlidingWindow(new int[]{1, 3, -1, -3, 5, 3, 6, 7}, 3);
    }

    private static void test560(Solution solution) {
        solution.subarraySum(new int[]{1, 1, 1}, 2);
    }

    private static void test42(Solution solution) {
        solution.trap(new int[]{0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1});
    }

    private static void test11(Solution solution) {
        solution.maxArea(new int[]{1, 1});
    }

    private static void test283(Solution solution) {
        solution.moveZeroes(new int[]{2, 1, 0, 3, 12});
    }

    private static void test128(Solution solution) {
        solution.longestConsecutive(new int[]{0, 3, 7, 2, 5, 8, 4, 6, 0, 1});
    }


    private static void test2131(Solution solution) {
        //String[] strings = {"qo","fo","fq","qf","fo","ff","qq","qf","of","of","oo","of","of","qf","qf","of"};
        String[] strings = {"bb", "bb"};
        System.out.println(solution.longestPalindrome(strings));
    }

    private static void test3362(Solution solution) {
        int[] nums = new int[]{2, 0, 2};
        int[][] query = new int[][]{{0, 2}, {0, 2}, {1, 1}};
        System.out.println(solution.maxRemoval(nums, query));
    }

    private static void test3356(Solution solution) {
        int[] nums = new int[]{2, 0, 2};
        int[][] query = new int[][]{{0, 2, 1}, {0, 2, 1}, {1, 1, 3}};
        System.out.println(solution.minZeroArray(nums, query));
    }

    private static void test3355(Solution solution) {
        int[] nums = new int[]{1, 0, 1};
        int[][] query = new int[][]{{0, 2}};
        System.out.println(solution.isZeroArray(nums, query));
    }

    private static void test(Solution solution) {
        int a = 1;
        int b = 1;
        a ^= a;
        a ^= a;
        a ^= a;
        System.out.println(a);
    }

    private static void test75(Solution solution) {
        int[] ints = {1};
        solution.sortColors(ints);
        for (int i = 0; i < ints.length; i++) {
            System.out.print(ints[i]);
        }
    }

    private static void test4(Solution solution) {
        int[] ints1 = {2, 3};
        int[] ints2 = {};
        System.out.println(solution.findMedianSortedArrays(ints1, ints2));
    }

    private static void test2901(Solution solution) {
        solution.getWordsInLongestSubsequence(new String[]{"cdb", "cdd", "cd", "dcc", "cca", "cda", "ca", "cc", "bcc"},
                new int[]{8, 5, 9, 5, 2, 7, 4, 7, 3}).forEach(System.out::println);
    }

}
